package com.yoomiito.app.adapter.my;

import androidx.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseItemDraggableAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.my.BillItemBean;

import java.util.List;

public class MyBillAdapter extends BaseItemDraggableAdapter<BillItemBean, BaseViewHolder> {

    public MyBillAdapter(@Nullable List<BillItemBean> data) {
        super(R.layout.item_my_bill, data);
    }


    @Override
    protected void convert(final BaseViewHolder helper, BillItemBean item) {
        ((TextView)helper.getView(R.id.tv_key)).setText(item.getKey());
        ((TextView)helper.getView(R.id.tv_value)).setText(item.getValue());
        if (helper.getLayoutPosition() == (getItemCount() - 1)){
            helper.setVisible(R.id.view_divide,false);
        }else{
            helper.setVisible(R.id.view_divide,true);
        }
    }
}
